import type {BasicColumn, FormSchema} from '@/components/Table'
import {useRender} from '@/components/Table'

export const columns: BasicColumn[] = [
  {
    title: '交易日期',
    dataIndex: 'tradeDate',
    width: 160,
    customRender: ({ text }) => {
      return useRender.renderDate(text)
    }
  },
  {
    title: '增加备付金存款余额的业务',
    width: 160,
    children: [
      {
        title: '向备付金银行交存现金形式备付金',
        dataIndex: 'e01',
        width: 160
      },
      {
        title: '非备付金集中存管账户计付的利息收入',
        dataIndex: 'e02',
        width: 160
      },
      {
        title: '备付金集中存管账户收到划拨的利息收入',
        dataIndex: 'e03',
        width: 160
      },
      {
        title: '备付金集中存管账户收到备付金专用存款账户归集的客户备付金',
        dataIndex: 'e04',
        width: 160
      },
      {
        title: '其他',
        dataIndex: 'e05',
        width: 160
      },
    ]
  },
  {
    title: '减少备付金存款余额的业务',
    width: 160,
    children: [
      {
        title: '利息收入划拨存备付金集中存管账户（备付金专用存款账户）',
        dataIndex: 'f01',
        width: 160
      },
      {
        title: '银行扣取手续费、管理费等费用',
        dataIndex: 'f02',
        width: 160
      },
      {
        title: '结转利息收入（备付金集中存管账户）',
        dataIndex: 'f03',
        width: 160
      },
      {
        title: '结转手续费收入（备付金集中存管账户）',
        dataIndex: 'f04',
        width: 160
      },
      {
        title: '办理预付卡先行现金赎回业务',
        dataIndex: 'f05',
        width: 160
      },
      {
        title: '向备付金集中存管账户划转的客户备付金（备付金专用存款账户）',
        dataIndex: 'f06',
        width: 160
      },
      {
        title: '其他',
        dataIndex: 'f07',
        width: 160
      }
    ]
  },
  {
    title: '创建时间',
    dataIndex: 'createTime',
    width: 180,
    customRender: ({ text }) => {
      return useRender.renderDate(text)
    }
  },
]

export const searchFormSchema: FormSchema[] = [
  {
    label: '交易日期',
    field: 'tradeDate',
    component: 'RangePicker',
    colProps: { span: 8 }
  },
]

export const createFormSchema: FormSchema[] = [

  {
    label: '编号',
    field: 'id',
    show: false,
    component: 'Input'
  },
  {
    label: '交易日期',
    field: 'tradeDate',
    component: 'DatePicker',
    required: true,
    labelWidth: 400,
    componentProps: {
      showTime: false,
      format: 'YYYY-MM-DD',
      valueFormat: 'x',
    }
  },
  {
    label: '向备付金银行交存现金形式备付金（e01）',
    field: 'e01',
    required: true,
    labelWidth: 400,
    component: 'InputNumber',
    defaultValue: 0
  },
  {
    label: '非备付金集中存管账户计付的利息收入（e02）',
    field: 'e02',
    required: true,
    labelWidth: 400,
    component: 'InputNumber',
    defaultValue: 0
  },
  {
    label: '备付金集中存管账户收到划拨的利息收入（e03）',
    field: 'e03',
    required: true,
    labelWidth: 400,
    component: 'InputNumber',
    defaultValue: 0
  },
  {
    label: '备付金集中存管账户收到备付金专用存款账户归集的客户备付金（e04）',
    field: 'e04',
    required: true,
    labelWidth: 400,
    component: 'InputNumber',
    defaultValue: 0
  },
  {
    label: '其他（e05）',
    field: 'e05',
    required: true,
    labelWidth: 400,
    component: 'InputNumber',
    defaultValue: 0
  },
  {
    label: '利息收入划拨存备付金集中存管账户（f01）',
    field: 'f01',
    required: true,
    labelWidth: 400,
    component: 'InputNumber',
    defaultValue: 0
  },
  {
    label: '银行扣取手续费、管理费等费用（f02）',
    field: 'f02',
    required: true,
    labelWidth: 400,
    component: 'InputNumber',
    defaultValue: 0
  },
  {
    label: '结转利息收入（f03）',
    field: 'f03',
    required: true,
    labelWidth: 400,
    component: 'InputNumber',
    defaultValue: 0
  },
  {
    label: '结转手续费收入（f04）',
    field: 'f04',
    required: true,
    labelWidth: 400,
    component: 'InputNumber',
    defaultValue: 0
  },
  {
    label: '办理预付卡先行现金赎回业务（f05）',
    field: 'f05',
    required: true,
    labelWidth: 400,
    component: 'InputNumber',
    defaultValue: 0
  },
  {
    label: '向备付金集中存管账户划转的客户备付金（f06）',
    field: 'f06',
    required: true,
    labelWidth: 400,
    component: 'InputNumber',
    defaultValue: 0
  },
  {
    label: '其他（f07）',
    field: 'f07',
    required: true,
    labelWidth: 400,
    component: 'InputNumber',
    defaultValue: 0
  },
]

export const updateFormSchema: FormSchema[] = [
  {
    label: '编号',
    field: 'id',
    show: false,
    component: 'Input'
  },
  {
    label: '交易日期',
    field: 'tradeDate',
    component: 'DatePicker',
    required: true,
    labelWidth: 400,
    componentProps: {
      showTime: false,
      format: 'YYYY-MM-DD',
      valueFormat: 'x',
    }
  },
  {
    label: '向备付金银行交存现金形式备付金（e01）',
    field: 'e01',
    required: true,
    labelWidth: 400,
    component: 'InputNumber'
  },
  {
    label: '非备付金集中存管账户计付的利息收入（e02）',
    field: 'e02',
    required: true,
    labelWidth: 400,
    component: 'InputNumber'
  },
  {
    label: '备付金集中存管账户收到划拨的利息收入（e03）',
    field: 'e03',
    required: true,
    labelWidth: 400,
    component: 'InputNumber'
  },
  {
    label: '备付金集中存管账户收到备付金专用存款账户归集的客户备付金（e04）',
    field: 'e04',
    required: true,
    labelWidth: 400,
    component: 'InputNumber'
  },
  {
    label: '其他（e05）',
    field: 'e05',
    required: true,
    labelWidth: 400,
    component: 'InputNumber'
  },
  {
    label: '利息收入划拨存备付金集中存管账户（f01）',
    field: 'f01',
    required: true,
    labelWidth: 400,
    component: 'InputNumber'
  },
  {
    label: '银行扣取手续费、管理费等费用（f02）',
    field: 'f02',
    required: true,
    labelWidth: 400,
    component: 'InputNumber'
  },
  {
    label: '结转利息收入（f03）',
    field: 'f03',
    required: true,
    labelWidth: 400,
    component: 'InputNumber'
  },
  {
    label: '结转手续费收入（f04）',
    field: 'f04',
    required: true,
    labelWidth: 400,
    component: 'InputNumber'
  },
  {
    label: '办理预付卡先行现金赎回业务（f05）',
    field: 'f05',
    required: true,
    labelWidth: 400,
    component: 'InputNumber'
  },
  {
    label: '向备付金集中存管账户划转的客户备付金（f06）',
    field: 'f06',
    required: true,
    labelWidth: 400,
    component: 'InputNumber'
  },
  {
    label: '其他（f07）',
    field: 'f07',
    required: true,
    labelWidth: 400,
    component: 'InputNumber'
  },
]
